package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author rephilo
 */
@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    @GetMapping("/User/{id}")
    public User getUserById(@PathVariable Integer id) {
        return userService.getById(id);
    }
}
